package org.biojava.services.das.servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;

import org.quartz.JobExecutionException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import uk.ac.sanger.dasregistry.timer.CleanRegistry;


public class CleanRegistryServlet extends HttpServlet{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void service(ServletRequest request,
			ServletResponse response)
	throws IOException, ServletException
	{
		BeanFactory ctx=(new ClassPathXmlApplicationContext("SpringDAO.xml"));
		
		CleanRegistry clean=(CleanRegistry) ctx.getBean("clean");
		
			System.out.println("clean registry called");
			clean.cleanServers();
		

	}
}
